
var _MA = {
    serviceURL: "http://rdlog.todo.vn",
    run: function () {
        var a = ["url=" + encodeURIComponent(window.document.location.href), "title=" + encodeURIComponent(window.document.title), "ref=" + encodeURIComponent(window.document.referrer), "plat=" + window.navigator.platform, "lang=" + (window.navigator.userLanguage || window.navigator.language), "cookie=" + (window.navigator.cookieEnabled ? 1 : 0), "encoding=" + (window.document.inputEncoding || window.document.charset), "resol=" + (window.innerWidth || window.screen.availWidth) + "x" + (window.innerHeight || window.screen.availHeight), "uid=0","current_city=TP Hồ Chí Minh","user_email=0"];
        var b = new Image;
        b.src = this.serviceURL + "/_ma.gif?" + a.join("&")
    },
    checkout: function (a) {
        var b = {
            sitekey: "vcc",
            productID: 0,
            quantity: 0,
            orderID: 0,
            userID:0,
        };
        var c = this.extend(b, a);
        var d = new Image;
        d.src = this.serviceURL + "/_mab.gif?sitekey=" + c.sitekey + "&deal_id=" + c.productID + "&quantity=" + c.quantity + "&order_id=" + c.orderID + "&user_id=" + c.userID + "&ref=" + encodeURIComponent(window.document.referrer)
    },

    order: function (a) {   
        var b = {

            sitekey: "vcc",
            productID: 0,
            userId: 0,
            email: "",
            urlDetail: "",
        };
        var c = this.extend(b, a);
        var d = new Image;
        d.src = this.serviceURL + "/_mab2.gif?sitekey=" + c.sitekey + "&deal_id=" + c.productID + "&user_id=" + c.userId + "&email=" + c.email +  "&url_detail=" + c.urlDetail +"&referrer=" + encodeURIComponent(document.referrer)
        
        
    },
    subscribe: function (a) {
        var b = {
            sitekey: "vcc",
            email: ""
        };
        var c = this.extend(b, a);
        var d = new Image;
        d.src = this.serviceURL + "/_mas.gif?sitekey=" + c.sitekey + "&email=" + c.email
    },
    register: function (a) {
        var b = {
            sitekey: "vcc",
            email: "",
            uid: 0
        };
        var c = this.extend(b, a);
        var d = new Image;
        d.src = this.serviceURL + "/_mar.gif?sitekey=" + c.sitekey + "&email=" + c.email + "&uid=" + c.uid
    },
    get_items: function (a) {
        var b = {
            sitekey: 'vcc',
            current_item_id: 0,
            selected_item_id: 0,
            status: ''
        };
        var c = this.extend(b, a);
        var timg = new Image();
        timg.src = this.serviceURL + '/_get_items.gif?sitekey=' + c.sitekey + '&current_item_id=' + c.current_item_id + '&selected_item_id=' + c.selected_item_id + '&status=' + c.status
    },
    get_users: function (a) {
        var b = {
            sitekey: 'vcc',            
            uid: 0,
            email: ''
        };
        var c = this.extend(b, a);
        var timg = new Image();
        timg.src = this.serviceURL + '/_get_users.gif?sitekey=' + c.sitekey + '&uid=' + c.uid + '&email=' + c.email
    },    
    extend: function () {
        var a = arguments,
            b = a[0] || {}, c = 1,
            d = a.length,
            e = false,
            f;
        if (typeof b === "boolean") {
            e = b;
            b = a[1] || {};
            c = 2
        }
        if (typeof b !== "object" && !this.isFunction(b)) b = {};
        for (; c < d; ++c) {
            if ((f = a[c]) != null) {
                for (var g in f) {
                    var h = b[g],
                        i = f[g];
                    if (b === i) continue;
                    if (e && i && typeof i === "object" && !i.nodeType) {
                        b[g] = extend(e, h || (i.length != null ? [] : {}), i)
                    } else if (i !== undefined) {
                        b[g] = i
                    }
                }
            }
        }
        return b
    },
    isFunction: function (a) {
        return Object.prototype.toString.call(a) === "[object Function]"
    },
    isArray: function (a) {
        return Object.prototype.toString.call(a) === "[object Array]"
    },
    isObject: function (a) {
        return Object.prototype.toString.call(a) === "[object Object]"
    },
    isEmpty: function (a) {
        if (Object.prototype.toString.call(a) !== "[object Object]") {
            return false
        }
        for (var b in a) {
            if (a.hasOwnProperty(b)) {
                return false
            }
        }
        return true
    }
};
_MA.run()